home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / mlib / include / mhash.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-06  |  781 b   |  29 lines

  1.  
  2. #ifndef __MHASH_H
  3. #define __MHASH_H
  4.  
  5. typedef WORD             HKeyType;
  6.  
  7. class HashEntry {
  8. protected:
  9.     HKeyType                  Key;
  10. protected:
  11.     virtual void             CreateKey (void) = 0;
  12. public:
  13.                  HashEntry (void) {Key = 0;};
  14.     virtual inline HKeyType  GetHashKey (void) { return (Key);};
  15.     virtual BOOL             operator== (const HashEntry& AnEntry) = 0;
  16. };
  17.  
  18. class HashTable : public Atom {
  19. public:
  20.                  HashTable (WORD TableSize = MAXWORD);
  21.     virtual void             InsertEntry (HashEntry * NewEntry);
  22.     virtual HashEntry *      RetrieveEntry (HashEntry * JustLikeIt);
  23.     virtual void             DeleteEntry (HashEntry * JustLikeIt);
  24.     virtual void             Resize (WORD NewSize);
  25.                 ~HashTable (void);
  26. };
  27.  
  28. #endif
  29.